package com.qen.boot;

import com.qen.encrypt.filter.DecryptRequestFilter;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
@RequiredArgsConstructor
public class SecurityConfigUp {

    private static final Logger logger = LoggerFactory.getLogger(SecurityConfigUp.class);

    @Autowired
    private DecryptRequestFilter decryptRequestFilter;

    @Bean
    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
        // TODO 等别的规则
        return http.addFilter(decryptRequestFilter).build();
    }

}
